package homework.day28;

public class Prob2 {
	
	public String leftPad(String str, int size, char padChar) {
		
		if(str.length() >= size) {
			return str;
		}
		
		String str2 = "";
		for(int i=0; i<size-str.length(); i++) {
			str2 += padChar;
		}
		str2 += str;
		
		return str2;
	}
	
	public static void main(String[] args) {
		
		Prob2 prob = new Prob2();
		
		System.out.println(prob.leftPad("ABC", 6, '#'));
		System.out.println(prob.leftPad("ABC", 5, '$'));
		System.out.println(prob.leftPad("ABC", 2, '&'));
	}

}
